import 'package:json_annotation/json_annotation.dart';

//定义生成的文件 flutter pub run build_runner build --delete-conflicting-outputs
part 'km_base_response.g.dart';

@JsonSerializable(explicitToJson: true)
class BaseKMResponse{

  bool status;
  String? message;

  BaseKMResponse(
      {
        required this.status,
        required this.message,
      }
      );

  //添加固定格式
  factory BaseKMResponse.fromJson(Map<String, dynamic> json) => _$BaseKMResponseFromJson(json);
  Map<String, dynamic> toJson() => _$BaseKMResponseToJson(this);


}

@JsonSerializable(explicitToJson: true)
class Response_km_xiaopiao extends BaseKMResponse{

   String? data;
   String? requestId;
   String? time;

   Response_km_xiaopiao(
      {
        this.data,
        this.requestId,
        this.time,
        super.status=false,
        super.message,
      }
      );

  //添加固定格式
  factory Response_km_xiaopiao.fromJson(Map<String, dynamic> json) => _$Response_km_xiaopiaoFromJson(json);
  Map<String, dynamic> toJson() => _$Response_km_xiaopiaoToJson(this);

}